package labox.innovation.gameserver.skills.conditions;

import labox.innovation.gameserver.model.actor.L2Character;
import labox.innovation.gameserver.model.actor.instance.FuzePcInstance;
import labox.innovation.gameserver.skills.Env;

/**
 * @author mkizub
 * 
 */
public class ConditionPlayerBaseStats extends Condition {

	private final BaseStat _stat;
	private final int _value;

	public ConditionPlayerBaseStats(L2Character player, BaseStat stat, int value) {
		super();
		_stat = stat;
		_value = value;
	}

	/**
	 * 
	 * @see labox.innovation.gameserver.skills.conditions.Condition#testImpl(labox.innovation.gameserver.skills.Env)
	 */
	@Override
	public boolean testImpl(Env env) {
		if (!(env.player instanceof FuzePcInstance))
			return false;
		FuzePcInstance player = (FuzePcInstance) env.player;
		switch (_stat) {
		case Int:
			return player.getINT() >= _value;
		case Str:
			return player.getSTR() >= _value;
		case Con:
			return player.getCON() >= _value;
		case Dex:
			return player.getDEX() >= _value;
		case Men:
			return player.getMEN() >= _value;
		}
		return false;
	}
}

enum BaseStat {
	Int, Str, Con, Dex, Men, Wit
}
